package com.mycase.im.boot.controller;

import com.mycase.im.boot.entity.database.ImUser;
import com.mycase.im.boot.service.UserService;
import com.mycase.im.boot.entity.communication.ResponseMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

import static com.mycase.im.boot.entity.communication.ResponseMessage.success;

/**
 * @Author ZhuHJay
 * @Date 2021/8/17 11:23
 */
@RestController
public class RegisterController {

    @Autowired
    private UserService userService;

    @PostMapping("/register")
    public ResponseMessage register(@Valid ImUser imUser){

        userService.register(imUser);

        return success();
    }

}
